import { Navigate } from 'react-router'
import { lazy } from 'react'

//登录页面
const Login = lazy(() => import('../page/login'))
//主页面
const Main = lazy(() => import('../page/main'))

//统计分析
const Statistic = lazy(() => import('../page/statistic'))

//查询网点人员
const Personnel = lazy(() => import('../page/personnel'))


//网点查看
const Branch = lazy(() => import('../page/branch'))
//取现记录
const TakeRecord = lazy(() => import('../page/takeRecord'))
//上传风险库文件
const UploadRiskFile = lazy(() => import('../page/upLoadRiskFile'))

//测试1
const Test1 = lazy(() => import('../page/test1'))
//测试2
const Test2 = lazy(() => import('../page/test2'))

//高级设置
const AdvancedSetting = lazy(() => import('../page/advancedSetting'))


const element = [
	{
		path: 'login',
		element: <Login />
	},
	{
		path: 'main',
		element: <Main />,
		children: [
			{
				path: 'statistic',
				element: <Statistic />,
			},
			{
				path: 'personnel',
				element: <Personnel />,
				children: [
					{
						path: 'test1',
						element: <Test1 />,
					},
					{
						path: 'test2',
						element: <Test2 />,
					},
				]
			},
			{
				path: 'branch',
				element: <Branch />,
			},
			{
				path: 'advancedSetting',
				element: <AdvancedSetting />,
			},
			{
				path: 'takeRecord',
				element: <TakeRecord />,
			},
			{
				path: 'uploadRiskFile',
				element: <UploadRiskFile />,
			}
		]
	},
	//严格模式，去掉缺省
	{
		path: '/',
		element: <Navigate to='login' />
	}
]


export default element;
